Skip to content

stdarch-test: various cleanups #1860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

folkertdev
Copy link
Contributor

My goal here was to make the instruction matching stricter, to prevent accepting e.g. fminnm when the test specifies the fmin instruction must be used.

But especially on x86 there are lots of cases where a prefix is (deliberately?) used.

Anyway, I also made some other cleanups. Can be reviewed commit-by-commit.

@rustbot
Copy link
Collaborator

rustbot commented Jul 10, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

let found = expected == "nop"
|| instrs.iter().any(|instruction| {
instruction.starts_with(expected)
// Check that the next character is non-alphabetic. This prevents false negatives
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect digits (is_ascii_digit) to also be part of the instruction name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what I had earlier, but it gave lots of hits for ld1 where the test just asserts on ld

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any intrinsics that specifically match on "ld". All the load instrinsics explicitly specify the number since this is an important part of the instruction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm maybe it was a different instruction? In any case it gave a lot of false positives somewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if this included digits and had a way to explicitly opt-in to wildcard matching.

// Check that the next character is non-alphabetic. This prevents false negatives
// when e.g. `fminnm` was used but `fmin` was expected.
//
// TODO: resolve the conflicts (x86_64 has a bunch, probably others)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you intending to have this merged as it is, or wait for x86 conflicts to be resolved first? I'm happy to merge either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to go, we can work through the false positives over time (it's not the most fun task).

@folkertdev folkertdev force-pushed the stdarch-test-cleanup branch from 77ccca1 to ded4a23 Compare July 14, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants